package com.wntms.auser.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wntms.auser.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserDao extends BaseMapper<User>{

    /**
     * 根据用户名查询数据
     * @param username
     * @return
     */
    @Select("select * from user where account = #{username}")
    public User findByUserName(String username);

    /**
     * 添加用户
      * @param user
     * @return
     */
    @Insert("insert into user values(null,null,#{account},#{password})")
    public int insertUser(User user);
}
